package com.anhua.Util;

import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

@Configuration
@EnableConfigurationProperties(HelloProperties.class)
@Import(Student2.class)
//@ConditionalOnMissingBean(name = "dynamicSecurityService")
public class HelloServicrAutoConfiguration {

    private HelloProperties helloProperties;
    public HelloServicrAutoConfiguration(HelloProperties helloProperties) {
        this.helloProperties = helloProperties;
    }
    @Bean
    public HelloService HelloService(HelloProperties helloProperties){
       return new HelloService(helloProperties.getName(),helloProperties.getHome(),helloProperties.getAge());
            }

    public HelloServicrAutoConfiguration() {
    }
}
